#ifndef _STATE_MACHINE_H_
#define _STATE_MACHINE_H_

#include "stdint.h"
#include "stdlib.h"
typedef struct state_t
{
	uint8_t ID;
	
	void (*State_Task_Callback)(void);
	uint8_t(*State_Change_Callback)(void);
} state_t;

typedef struct state_machine_t
{
	uint8_t State_Total;
	uint64_t isRegister;
	uint8_t ID_Now;
	uint8_t isInit;
	state_t* state;
} state_machine_t;


void State_Init(state_machine_t* state_machine,uint8_t State_Total,uint8_t Begin_ID);
uint8_t State_Config(	state_machine_t* state_machine,
											uint16_t ID ,
											void (*State_Task)(void),
											uint8_t(*State_Change)(void));
void State_TIM(state_machine_t* handle);
void State_Main(state_machine_t* handle);
#endif //_STATE_MACHINE_H_
